package com.swgk.core.view.adapter;

import android.content.Context;
import android.view.View;

import com.swgk.core.BR;
import com.swgk.core.R;
import com.swgk.core.databinding.ItemCategoryLeft3Binding;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.view.entity.MenuEntity;

import java.util.List;

public class CategoryLeftAdapter3 extends BaseRecycleAdapter<MenuEntity<MenuEntity<MenuEntity>>> {

    public CategoryLeftAdapter3(Context context, List<MenuEntity<MenuEntity<MenuEntity>>> datas) {
        super(context, R.layout.item_category_left3, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, MenuEntity<MenuEntity<MenuEntity>> entity) {
        holder.setBinding(BR.viewModel, entity);
        boolean selected = holder.itemView.isSelected();
        ((ItemCategoryLeft3Binding) holder.getmBinding()).categoryMark.setVisibility(selected ? View.VISIBLE : View.INVISIBLE);
    }
}
